package com.tzjw.marketweixin.config;

import com.tzjw.marketweixin.interceptor.CustomInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 自定义一些web配置：
 *  静态资源映射 -> addResourceHandlers
 *  拦截器interceptor -> addInterceptors
 * @author hayden
 * @since 2023/09/16 14:20
 */
@Configuration
public class SpringmvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CustomInterceptor()).addPathPatterns("/home/**");
    }
}


